#include "../../include/thread/runnable.h"

class RunnableData
{
public:
    RunnableData();
private:
    friend class Runnable;
    bool is_auto_delete;
    std::string runnable_name;
};

RunnableData::RunnableData()
    : is_auto_delete(true)
{

}

Runnable::Runnable()
    : data_(std::make_unique<RunnableData>())
{

}
Runnable::Runnable(const std::string &name)
    : data_(std::make_unique<RunnableData>())
{
    data_->runnable_name = name;
}
Runnable::~Runnable() = default;

bool Runnable::autoDelete() const
{
    return data_->is_auto_delete;
}
void Runnable::setAutoDelete(bool autoDelete)
{
    data_->is_auto_delete = autoDelete;
}
void Runnable::setRunnableName(const std::string &name)
{
    data_->runnable_name = name;
}
std::string Runnable::getRunnableName() const
{
    return data_->runnable_name;
}

